﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BIS.Portal.Core.Base;
using BIS.Portal.Core.Global;

namespace BIS.Portal.Modules.CMS
{
    public partial class CmsArticleDetailControl_Settings : ControlSettingBase
    {
        #region Get data settings
        
        public bool HienThiAnhMinhHoa
        {
            get
            {
                return GetControlSetting<bool>(ModuleSettingNames.CmsArticleDetail.ddlAnhMinhHoa,
                                               PortalContext.LanguageAlias);
            }
        }
        public bool HienThiTieuDe
        {
            get
            {
                return GetControlSetting<bool>(ModuleSettingNames.CmsArticleDetail.ddlTieuDe,
                                               PortalContext.LanguageAlias);
            }
        }
        public bool HienThiMoTa
        {
            get
            {
                return GetControlSetting<bool>(ModuleSettingNames.CmsArticleDetail.ddlMoTa,
                                               PortalContext.LanguageAlias);
            }
        }

        #endregion
        protected void Page_Load(object sender, EventArgs e)
        {
            loadData();
        }
        private  void loadData()
        {
            ddlAnhMinhHoa.SelectedIndex = HienThiAnhMinhHoa ? 0 : 1;
            ddlTieuDe.SelectedIndex = HienThiTieuDe? 0 : 1;
            ddlMoTa.SelectedIndex = HienThiMoTa? 0 : 1;
        }
        public override void SaveSettings(Dictionary<string, string> settings)
        {
            SetControlSettingForAllLanguages(ddlAnhMinhHoa.ID,ModuleSettingNames.CmsArticleDetail.ddlAnhMinhHoa,settings);
            SetControlSettingForAllLanguages(ddlTieuDe.ID, ModuleSettingNames.CmsArticleDetail.ddlTieuDe, settings);
            SetControlSettingForAllLanguages(ddlMoTa.ID, ModuleSettingNames.CmsArticleDetail.ddlMoTa, settings);
        }

    }
}